#ifndef SOCKET_H
#define SOCKET_H

#include <string>
#include <netinet/in.h>

class Socket {
public:
    Socket(const std::string& ip, uint16_t port);
    ~Socket();

    int fd() const { return sockfd_; }

    void setReuseAddr(bool on);
    void bind();
    void listen();

private:
    int sockfd_;
    sockaddr_in addr_;
};

#endif